// Copyright (c) 2019 Presto Labs Pte. Ltd.
// Author: donggu

#include "coin2/base/string_util.h"

#include <boost/algorithm/string.hpp>
#include <doctest.h>
#include <nanobench.h>

DOCTEST_TEST_CASE("bench string.split") {
  std::vector<std::string> tokens;
  ankerl::nanobench::Bench()
      .run("prest::split", [&] { tokens = Split(".-BTC.USD-2020392.", ".-"); })
      .doNotOptimizeAway(tokens);
  ankerl::nanobench::Bench()
      .run(
          "boost::split",
          [&] { boost::split(tokens, ".-BTC.USD-2020392.", boost::is_any_of(".-")); })
      .doNotOptimizeAway(tokens);
}
